import java.util.Scanner;
public class Main1 {
	public static void main(String args[]) {
		Scanner can= new Scanner(System.in);
		int[] shuzu = new int[10];
		for(int i=0;i<shuzu.length;i++) {
			shuzu[i] = can.nextInt();
		}
		int a= 0;
		int b= shuzu.length;
		for(int i=0;i<b-1;i++) {
			for(int j=0;j<b-1-i;j++) {
				if(shuzu[j] > shuzu[j+1]) {
					a= shuzu[j];
					shuzu[j] = shuzu[j+1];
					shuzu[j+1] =a;
				}
			}
		}
		System.out.print("max="+shuzu[shuzu.length-1]+","+"cmax="+shuzu[shuzu.length-2]);
	}
}
